<?php 
include_once('connection/connection.php');
include('header.php');
include('menu.php');
include('config.php');
function getName($colName,$id)
{
	$sqlgetName="select distinct ".$colName."_name from tbl_lookup_location where ".$colName."_id=".$id;
	$querygetName=mysql_query($sqlgetName);
	$rowgetName=mysql_fetch_row($querygetName);
	return $rowgetName[0];
}
$frm=$_SESSION['form_id'];
$qr="select * from tbl_dtls_critical where form_id='$frm'";
$res=mysql_query($qr);
$row=mysql_fetch_array($res);
$dis=$row['district_id'];
$dis_name=getName('district',$dis);
$_SESSION['dis_name']=$dis_name;
$tehsil=$row['tehsil_id'];
$id1=$row['id'];
$_SESSION['id1']=$id1;
$qr1="select census_subdistrict_name from tbl_lookup_location where district_id='$dis' and census_subdistrict_code='$tehsil'";
$res1=mysql_query($qr1);
$row1=mysql_fetch_array($res1);
if(isset($_POST['back']))
{ 
	header('Location: view_critical.php');
}	
if(isset($_POST['submit']))
{ 
	//echo $form_id=$_POST['form_id'];
	//echo $_SESSION['form_id']=$form_id;
	header('Location: view_critical_2.php');
}	
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/style_question.css" type="text/css" rel="stylesheet" />
<title>View Q1</title>
</head>
<body>
<div align="center">
<form action="" method="post" enctype="multipart/form-data">
	<table border="0" width="802" id="table1" cellspacing="0" cellpadding="0">
		<tr>
			<td height="30">
			<p align="center">
			<font face="Verdana" style="font-size: 10pt; font-weight: 700" color="#000000">Critical Village </font></td>
		</tr>
		<tr>
			<td height="19" align="center"><font face="Arial" style="font-size: 8.5pt" color="#000000">(For PHED Officials)</font></td>
		</tr>
		<tr>
			<td align="center"><font face="Arial" style="font-size: 8.5pt" color="#000000">Page 1</font></td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td bgcolor="#EEEEEE" height="22"><font color="#000000">&nbsp;
			<font style="font-size: 8.5pt; font-weight: 700" face="Arial">
			Main Location </font></font>			</td>
		</tr>
		<tr>
			<td height="66">
				<table border="1" width="800" id="table2" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
					<tr>
						<td colspan="4">
							<span style="font-size: 4pt">&nbsp;</span>						</td>
					</tr>
					<tr>
						<td width="157" height="25">
							<font face="Verdana" style="font-size: 8.5pt" color="#000000"><font color=                            "#FF0000">&nbsp;&nbsp;*</font>District</font>						</td>
						<td width="270"><label id="district"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php $id="$row[district_id]"; echo getName('district',$id);?></font></label></td>
						<td width="111">
							<font face="Verdana" style="font-size: 8.5pt" color="#000000"><font color=                            "#FF0000">*</font>Date&nbsp;&nbsp;</font>						</td>
            			<td width="207"><label id="date"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php echo "$row[date]";?></font></label></td>
					</tr>
					<tr>
						<td width="157" height="28">
							<font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;
							<font color="#FF0000">*</font>Block </font>						</td>
						<td width="270"><label id="block"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php $id="$row[block_id]"; echo getName('block',$id);?></font></label></td>
						<td width="111">
							<font face="Verdana" style="font-size: 8.5pt" color="#000000"><font color=                        	"#FF0000">*</font>Revenue &nbsp;&nbsp;Tehsil&nbsp;&nbsp;&nbsp;</font>						</td>
						<td width="207"><label id="tehsil"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php $id="$row[tehsil_id]"; echo "$row1[census_subdistrict_name]"?></font></label></td>
			    	</tr>
				</table>		  </td>
		</tr>
		<tr>
			<td><span style="font-size: 4pt">&nbsp;</span></td>
		</tr>
		
		
		
	<tr>
		<td>
			<span style="font-size: 5pt">&nbsp;</span>		</td>
	</tr>
	<tr>
		<td bgcolor="#EEEEEE" height="22"><font color="#000000">&nbsp;
			<font style="font-size: 8.5pt; font-weight: 700" face="Arial">
			1. Location </font></font>		</td>
	</tr>
	<tr>
		<td>
			<table border="1" width="800" id="table7" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
				<tr>
					<td height="11" colspan="4">
						<span style="font-size: 4pt">&nbsp;</span></td>
				</tr>
				<tr>
					<td width="287" height="29">
						<font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;&nbsp;<font color="#FF0000">*</font>Grampanchayat</font>					</td>
					<td width="504"><label id="gp"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php $id="$row[panchayat_id]"; echo getName('panchayat',$id);?></label></td>
				</tr>
				<tr>
					<td width="287">&nbsp;
						<font style="font-size: 8.5pt" face="Verdana" color="#000000"><font color="#FF0000">*</font>Village (s) Covered Names &nbsp;&nbsp;&nbsp;(MH)</font></td>
					<td width="504"><label id="village"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php $id="$row[village_id]"; echo getName('village',$id);?></label></td>
				</tr>
				<tr>
					<td width="287" height="24">&nbsp;
						<font style="font-size: 8.5pt" face="Verdana" color="#000000"><font color="#FF0000">*</font>Form Id</font></td>
					<td width="504"><label id="formid"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php echo "$row[form_id]";?></font></label></td>
				</tr>
				<tr>
					<td width="287" height="28">&nbsp;
						<font style="font-size: 8.5pt" face="Verdana" color="#000000"><font color="#FF0000">*</font>Census Village Code</font></td>
					<td width="504"><label id="census"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php echo "$row[cvc]";?></font></label></td>
				</tr>
				<tr>
					<td colspan="4" bgcolor="#EEEEEE">&nbsp;
					<font style="font-size: 8.5pt; font-weight: 700" face="Arial" color="#000000">
					3.Other Habitations (OH) covered</font></td>
				</tr>
			</table>		</td>
	</tr>
	<tr>
		<td>
			<table border="1" width="800" id="table4" cellspacing="1" cellpadding="0" bgcolor="#FDF9EE" style="border-collapse:collapse; border-color:#99CCCC;">
				<tr>
					<td colspan="9"><span style="font-size: 4pt">&nbsp;</span></td>
				</tr>
				<tr>
					<td width="14%" height="36" rowspan="2" align="center" bgcolor="#F7E6B7">
						<font face="Verdana" style="font-size: 8.5pt" color="#990000">Name of the Habitation </font></td>
					<td width="15%" height="36" rowspan="2" align="center" bgcolor="#F7E6B7">
						<font style="font-size: 8.5pt" face="Verdana" color="#990000">
						Code No. (As per IMIS)</font></td>
						<td align="center" width="11%" rowspan="2" bgcolor="#F7E6B7">
						<font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Type MH/ OH</font></td>
					   
				    <td width="13%" height="36" rowspan="2" align="center" bgcolor="#F7E6B7">
						<font face="Verdana" style="font-size: 8.5pt" color="#990000">
						Status(A/ NA)</font></td>
					<td width="14%" rowspan="2" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">Approx No. of Household in OH</font></td>
					<td colspan="4" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">Current Population</font></td>
				</tr>
				<tr>
				  <td width="8%" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">SC</font></td>
			      <td width="8%" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">ST</font></td>
			      <td width="8%" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">Others</font></td>
			      <td width="9%" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">Total</font></td>
			  </tr>	
				<?php
				$qr2="select * from tbl_dtls_critical_habit where loc_id='$id1' and habit_name !=''";
				$res2=mysql_query($qr2);
				while($row2=mysql_fetch_array($res2))
				{
				?>
				 <tr>
				<td width="14%" height="23" align="center"><label id="habit_name"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[habit_name]";?></font></label></td>
				<td width="15%" align="center"><label id="habit_code"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[habit_code]";?></font></label></td>
			   	<td align="center" width="11%"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[type_habit]";?></font></label></td>
				
				<td width="13%" align="center"><label id="status_e_nt"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[status_a_na]";?></font></label></td>
				 <td align="center" width="14%"><label id="status_e_nt"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[num_household_oh]";?></font></label></td>
				  <td align="center"><label id="status_e_nt"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[population_sc]";?></font></label></td>
				  <td align="center"><label id="status_e_nt"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[population_st]";?></font></label></td>
				  <td align="center"><label id="status_e_nt"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[population_other]";?></font></label></td>
				  <td align="center"><label id="status_e_nt"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[population_total]";?></font></label></td>
			    </tr>
			<?php } ?>
		</table>		</td>
	</tr>
	<tr>
		<td><div id="habit"></div></td>
	</tr>
	<tr>
		<td width="802" bgcolor="#EEEEEE">&nbsp;
			<span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">4. Population</font></span></td>
	</tr>
	<tr>
		<td>
			<table border="1" width="800" id="table8" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
				<tr>
					<td colspan="4">
						<span style="font-size: 4pt">&nbsp;</span>					</td>
				</tr>
				<tr>
				
					<td width="241" align="center">
						<font face="Verdana" style="font-size: 8.5pt" color="#000000"> 
						Population<br>
						(as per 2001 census)</font></td>
						
					<td width="191" align="center"><label id="population_benefited"><font face="Arial" style="font-size: 8.5pt">&nbsp;<?php echo "$row[population_01]";?></font></label></td>
					<td width="133" align="center">
						<font face="Verdana" style="font-size: 8.5pt" color="#000000">
						Present Population&nbsp;&nbsp;&nbsp; </font></td>
				  <td width="220" align="center"><label id="present_population"><font face="Arial" style="font-size: 8.5pt">&nbsp;<?php echo "$row[population_current]";?></font></label></td>
				</tr>
			</table>		</td>
	</tr>
	<tr>
	  <td width="802" bgcolor="#EEEEEE">&nbsp;
			<span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">4. Scheme Detail</font></span></td>
	  </tr>
	  <tr>
		<td>
			<table border="1" width="800" id="table8" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
				<tr>
					<td colspan="6">
						<span style="font-size: 4pt">&nbsp;</span>					</td>
				</tr>
				<tr>
				
					<td width="118" align="center">
						<font face="Verdana" style="font-size: 8.5pt" color="#000000"> 
						Type of the Scheme(As of Now)</font></td>
						
					<td width="96" align="center"><label id="population_benefited"><font face="Arial" style="font-size: 8.5pt">&nbsp;<?php echo "$row[scheme_type]";?></font></label></td>
					<td width="131" align="center"><font face="Verdana" style="font-size: 8.5pt" color="#000000">
					Status&nbsp;&nbsp;&nbsp; </font></td>
					<td width="129" align="center"><label id="population_benefited"><font face="Arial" style="font-size: 8.5pt">&nbsp;<?php echo "$row[scheme_status]";?></font></label></td>
					<td width="176" align="center">
						<font face="Verdana" style="font-size: 8.5pt" color="#000000">
						Present Water Demand(KLD)</font></td>
				  <td width="129" align="center"><label id="present_population"><font face="Arial" style="font-size: 8.5pt">&nbsp;<?php echo "$row[water_demand]";?></font></label></td>
				</tr>
			</table>		</td>
	</tr>
	<tr>
		<td width="802" bgcolor="#EEEEEE">&nbsp;<span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">5. Sources of Water for Agriculture Purposes</font></span>		</td>
	</tr>
	<tr>
		<td colspan="6">
			<table border="1" width="800" id="table10" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
				
				<tr>
					<td width="11920" colspan="6"><table border="1" width="800" id="table4" cellspacing="1" cellpadding="0" bgcolor="#FDF9EE" style="border-collapse:collapse; border-color:#99CCCC;">
					
				<tr align="center">
					<td width="196" height="20" align="center"><label id="source"><font style="font-size: 8.5pt" face="Verdana">Type of Sources</font></label></td>
				  	<td width="170" align="center"><label id="yield_max"><font style="font-size: 8.5pt" face="Verdana"><?php echo "$row[agri_source]";?></font></label></td>
					<td width="220" align="center"><label id="water_table_min"><font style="font-size: 8.5pt" face="Verdana">Power Availability of Power Supply(hrs)</font></label></td>
					<td width="199" align="center"><label id="water_table_max"><font style="font-size: 8.5pt" face="Verdana"><?php echo "$row[agri_power]";?></font></label></td>
				</tr>

</table></td></tr>
			</table>		</td>
	</tr>
	
	<tr>
		<td width="802" bgcolor="#EEEEEE">&nbsp;
			<span style="font-weight: 700"><font face="Arial" style="font-size: 8.5pt" color="#000000">6. Tanker Detail</font></span>		</td>
	</tr>
	<tr>
		<td height="57">
			<table border="1" width="800" id="table11" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
				<tr>
					<td colspan="6"><span style="font-size: 4pt">&nbsp;</span></td>
				</tr>
				<tr bgcolor="#F7E6B7">
				  <td height="21" align="center"><font face="Verdana" style="font-size: 8.5pt" color="#990000"> 
						Capacity(KL)</font></td>
				  <td align="center"><font face="Verdana" style="font-size: 8.5pt" color="#990000">No. of trips / day</font></td>
				  <td align="center"><font face="Verdana" style="font-size: 8.5pt" color="#990000">Supply(KLD)</font></td>
				  <td align="center"><font face="Verdana" style="font-size: 8.5pt" color="#990000">Type of source</font></td>
				  <td align="center"><font face="Verdana" style="font-size: 8.5pt" color="#990000">Distance(KM)</font></td>
				  <td align="center"><font face="Verdana" style="font-size: 8.5pt" color="#990000">Cost(Rs.)</font></td>
			  </tr>
				<tr>
				
				  <td height="21" align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[cap_4]";?>&nbsp;KL</font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[trip_4]";?></font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[supply_4]";?></font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[source_4]";?></font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[distance_4]";?></font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[cost_4]";?></font></label></td>
			  </tr>
				<tr>
				  <td height="21" align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[cap_5]";?>&nbsp;KL</font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[trip_5]";?></font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[supply_5]";?></font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[source_5]";?></font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[distance_5]";?></font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[cost_5]";?></font></label></td>
			  </tr>
				<tr>
				  <td height="21" align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[cap_10]";?>&nbsp;KL</font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[trip_10]";?></font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[supply_10]";?></font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[source_10]";?></font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[distance_10]";?></font></label></td>
				  <td align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[cost_10]";?></font></label></td>
			  </tr>
				<tr>
					<td width="82" height="21" align="center">
					<label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[other_cap]";?>&nbsp;KL</font></label></td>
					<td width="90" align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[other_trip]";?></font></label></td>
					<td width="109" align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[other_supply]";?></font></label></td>
					<td width="120" align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[other_source]";?></font></label></td>
					<td width="112" align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[other_distance]";?></font></label></td>
					<td width="117" align="center"><label id="water_table_max"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><?php echo "$row[other_cost]";?></font></label></td>
				</tr>
			</table>		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td>
			<p align="center">
			<input type="submit" value="Back" name="back" style="font-size: 8pt;font-family:Verdana; border-style: solid; border-width: 1px">&nbsp;&nbsp;
			<input type="submit" value="Next" name="submit" style="font-size: 8pt; font-family: Verdana; border-style: solid; border-width: 1px" onClick="return validate1()">&nbsp;</p>		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
	</tr>
</table>
</form>		
</div>
</body>
</html>

